<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class WorkRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'company' => 'required|max:50',
            'industry' => 'required|max:50',
            'job_title' => 'required|max:50',
            'start_time' => 'required|max:20',
            'over_time' => 'required|max:20',
            'report' => 'max:50',//汇报对象
            'subordinate_number' => 'numeric',
            'nianxin' => 'max:20',
            'nature' => 'max:50',
            'scale' => 'max:50',
            'department' => 'max:50',
            'company_introduction' => 'max:1000',
        ];
    }

    public function messages()
    {
        return [
            'company.required' => '请输入公司名称',
            'company.max' => '公司名称过长',
            'industry.required' => '请输入公司行业',
            'industry.max' => '公司行业过长',
            'job_title.required' => '请输入职位名称',
            'job_title.max' => '职位名称过长',
            'start_time.required' => '请选择开始工作时间',
            'start_time.max' => '开始工作时间错误',
            'over_time.required' => '请选择结束工作时间',
            'over_time.max' => '结束工作时间错误',
            'report.max' => '汇报对象过长',//汇报对象
            'subordinate_number.numeric' => '下属人数错误',
            'nianxin.max' => '年薪过长',
            'nature.max' => '公司性质过长',
            'scale.max' => '公司规模过长',
            'department.max' => '所在部门过长',
            'company_introduction.max' => '公司介绍过长',
        ];
    }
}
